package com.itcam.phaseiii.iostream_;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

/**
 * Author:Cammy.Wu
 * Date:2024-05-13
 * Description:对象流输出
 */

public class ObjectStream01 {
    public static void main(String[] args) throws IOException {
        ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(new File("E:\\IOStream\\ObjectStream01.txt")));

        // 将内存中的字符串写出到文件中
        oos.writeObject("Hello");

        // 关闭流
        oos.close();
    }
}
